/**
 * 各市实施进度排行榜
 */
(function() {
	'use strict';
	require(['orange','echarts'], function(orange,echarts) {
		var w = Math.floor(document.body.clientWidth*0.25)-5;
		$('#tcm_rank_chart').css({'width':w,'height':w*0.6});
		var myChart = echarts.init(document.getElementById('tcm_rank_chart')),
			cityData = ['玉溪','\n 昆明','\n \n丽江','临沧','\n 昭通',' \n \n 曲靖','普洱',' \n 保山','\n \n楚雄',' 文山',
		             '\n 德宏',' \n \n 迪庆','大理',' \n 红河','\n \n 西双版纳','怒江'],
            progressData=[32,31,34,39,33,35,45,46,19,18,17,10,23,35,54,33];
		var ydata=[];
		for(var j=0;j<cityData.length;j++){
			ydata.push(100);
		}
		var option = {
				tooltip : {
					trigger: 'item',
					axisPointer : {            
						type : 'shadow'        
					},
					formatter: "{b}: {c}%"
				},
				grid: {
			        bottom:90,
			    },
				legend: {
					data: ['实施进度'],
					textStyle:{
						color:'#EEE',
						fontSize:14
					},
					x:'left'
				},
				xAxis:  [{
					type: 'category',
					data: ['玉溪','\n 昆明','\n \n丽江','临沧','\n 昭通',' \n \n 曲靖','普洱',' \n 保山','\n \n楚雄',' 文山',
				             '\n 德宏',' \n \n 迪庆','大理',' \n 红河','\n \n 西双版纳','怒江'],
				    splitLine: {show: false},
					axisLine:{
						lineStyle:{//修改线条颜色
							color:'#EEE'
						}
					},
					axisLabel: {
			            textStyle: {
			                color: '#EEE',
			                fontSize:14
			            },
			            'interval':0//设定标签全部显示
			        }
				},
				{
			        // 辅助 x 轴
			        show: false,
			        axisLabel:{'interval':0},
			        data: ['玉溪','\n 昆明','\n \n丽江','临沧','\n 昭通',' \n \n 曲靖','普洱',' \n 保山','\n \n楚雄',' 文山',
				             '\n 德宏',' \n \n 迪庆','大理',' \n 红河','\n \n 西双版纳','怒江'],  
			    }],
				yAxis:
			        {
						type: 'value',
						axisLine:{
							lineStyle:{//修改线条颜色
								color:'#EEE'
							}
						},
						axisLabel: {
				            textStyle: {
				                color: '#EEE',
				                fontSize:14
				            }
				        }
			        },
		       series: [
		            {
		        	 // 辅助系列
		            	type: 'bar',
		            	silent: true,
		            	xAxisIndex: 1,
		            	itemStyle: {
		            		normal: {
		            			barBorderRadius: 20,
		            			color: 'rgba(221,221,221,0.8)'      
		            		}
		            	},
			            barWidth: 10,//单个柱的宽度
			            data:ydata
		            }, {
		       	   	  	name:'实施进度',
		       	   	  	type: 'bar',
		       	   	  	data: progressData,
		       	   	  	barWidth: 10,
		       	   	  	itemStyle: {
		       	   	  		normal: {
		       	   	  			barBorderRadius: 20,
		       	   	  			color: '#597FB8',
		       	   	  			shadowColor: 'rgba(0, 0, 0, 0.4)',
		       	   	  			shadowBlur: 20,
		       	   	  		}
		       	   	  	}
		            }
	            ]
			}; 
			myChart.setOption(option);
	});
})();